home *** CD-ROM | disk | FTP | other *** search
- GET (2.x/3.x Only) (Internal Command)
-
-
- NAME
- GET - Shows the contents of a local environment
- variable.
-
- SYNOPSIS
- GET varname
-
- DESCRIPTION
- A named text string that is stored in an environment
- space is a local environment variable. It can only be
- accessed through the shell it was created in or from a
- shell that was spawned from the shell it was created in.
-
- OK... so what's the difference between GET and
- SETENV. Well, SETENV is stored in the RAM disk and is
- global to all system functions. GET resides in some
- private (reserved) memory that may only be accessed as
- described above.
-
- By placing a dollar sign before the name, you can
- swap the value of a local environment variable on the
- command line. In other words, if you type 'ECHO $Peter'
- you are creating the same local environment variable as
- GET Peter.
-
-
- KEYWORDS
- varname
- This is the name of the environment variable to get.
-
- There are many local environment variables which are
- already created by the 2.x/3.x operating systems. The
- proper use of these makes AmigaDOS a very flexible and
- powerful scripting language. The more important and
- useful of these variables are:
-
- Process
- The process number of the current Shell
-
- Echo
- Decides whether or not the Shell will repeat each of
- the commands as they are executed. If 'SET Echo on', then
- the commands are repeated and displayed. Anyother use of
- Echo will not allow any commands to be repeated. Turning
- Echo on helps you to debug any scripts that you are
- having problems with, since there is no other way to tell
- how they failed. With Echo on, you can tell which line in
- the script failed to work.
-
- RC
- The return code of the last command that was
- executed. You can manipulate this return code instead of
- using IF WARN or IF FAIL commands structures. This is a
- more efficient programming algorythm routine.
-
- Result2
- The error number of why the last command failed. You
- can use the FAULT and/or WHY commands to try to figure
- out the exact nature of the error.
-
-
- EXAMPLES
-
- 1. To print the contents of an environment variable
- named StupidMahedi:
-
- GET StupidMahedi
-